using UnityEngine;
using System.Collections;

public class Weapon : MonoBehaviour 
{
	public float bulletSpeed = 10.0f;
	public float rocketSpeed = 20.0f;
	private float mTimer = 0.0f;
	public float dieTime = 2.0f;
	public Vector3 fireDirection = Vector3.up;
	public enum weaponState {Bullet, Rocket}
	public weaponState currWeapon = weaponState.Bullet;
	//public GameObject[] SomeArray;
	public
	
	// Use this for initialization
	void Start () 
	{

	}
	// Update is called once per frame
	void Update () 
	{
        transform.position = new Vector3(transform.position.x, transform.position.y, 0);
		switch(currWeapon)
		{
			case weaponState.Bullet:
				transform.Translate((fireDirection * bulletSpeed * Time.deltaTime));
				//rigidbody.MovePosition(rigidbody.position * bulletSpeed * Time.deltaTime)	
			if(!renderer.isVisible)
				{
					Destroy(gameObject);
				}
				else
				{
					mTimer += Time.deltaTime;
				}
				break;
			case weaponState.Rocket:
			
				break;
				
			default:
				break;
		}
	}
}
